<?php
session_start();
require_once("../includes/dbInfo.php");

function reloadProducts() {
    //Open XML file
    if(!$xml=simplexml_load_file("http://consort.cs.ualberta.ca:41046/c410/projserv/Products.xml")){
        trigger_error('Error reading XML file', E_USER_ERROR);
    }
    
    foreach ($xml->product as $p) {         
         $price = sprintf("%01.2f", $p->price);
         $productID = 
         // empty the table
         // reload the products
        $sql = "UPDATE products SET name = '$p->Name', size = '$p->size', price = margin + '$price', category = '$p->group'
                     WHERE productID = '$p[id]' ";               
        mysql_query($sql) or die( mysql_error());
    }
}
?>